package com.ssy.lingxi.platform.manage.controller.paas;

import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.platform.manage.model.request.common.CommonIdRequest;
import com.ssy.lingxi.platform.manage.model.request.onlineservice.EnableStatusReq;
import com.ssy.lingxi.platform.manage.model.request.onlineservice.OnlineServiceAddReq;
import com.ssy.lingxi.platform.manage.model.request.onlineservice.OnlineServiceUpdateReq;
import com.ssy.lingxi.platform.manage.service.paas.IOnlineServicePASSService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @menu 在线客服设置数据同步-PAAS接口
 * @author wyx
 * @version 2.0.0
 * @date 2021-11-16
 */
@RestController
@RequestMapping("/manage/paas/online/service")
public class OnlineServicePASSController {
    @Resource
    private IOnlineServicePASSService onlineServicePASSService;


    /**
     * 新增客服
     * @param req 请求参数
     * @return 操作结果
     */
    @RequestMapping(value = "/add", method = RequestMethod.POST)
    public Wrapper<Void> add(@RequestBody OnlineServiceAddReq req) {
        return onlineServicePASSService.add(req);
    }

    /**
     * 修改客服
     * @param req 请求参数
     * @return 操作结果
     */
    @RequestMapping(value = "/update", method = RequestMethod.POST)
    public Wrapper<Void> update(@RequestBody OnlineServiceUpdateReq req) {
        return onlineServicePASSService.update(req);
    }

    /**
     * 启用/停用
     * @param req 请求参数
     * @return 操作结果
     */
    @RequestMapping(value = "/enable", method = RequestMethod.POST)
    public Wrapper<Void> enable(@RequestBody EnableStatusReq req) {
        return onlineServicePASSService.enable(req);
    }

    /**
     * 删除客服配置
     * @param req 请求参数
     * @return 返回结果
     */
    @RequestMapping(value = "/delete", method = RequestMethod.POST)
    public Wrapper<Void> delete(@RequestBody CommonIdRequest req) {
        return onlineServicePASSService.delete(req);
    }
}
